@model PopUpAddressViewModel

@{
	string twoLettersCulture = new System.Globalization.CultureInfo(Culture).TwoLetterISOLanguageName;	
}

<div class="view-container">
  <!-- Form begin -->
  <div class="entity-form-container">
    @using (Html.BeginForm("", "", FormMethod.Post, new { id = "" })) {
      @Html.ValidationSummary(true)
      <fieldset>
        <legend>@Resources.AddressResources.Address</legend>
		<div class="form">
          @Html.HiddenFor(model => model.Id)
			<div class="field">
			  <div class="label">
				@Html.Label(Resources.AddressResources.AddressLine1)
			  </div>
			  <div class="editor">
				@Html.TextBoxFor(model => model.AddressLine1)
				@Html.ValidationMessageFor(model => model.AddressLine1)
			  </div>
			</div>
			<div class="field">
			  <div class="label">
				@Html.Label(Resources.AddressResources.AddressLine2)
			  </div>
			  <div class="editor">
				@Html.TextBoxFor(model => model.AddressLine2)
				@Html.ValidationMessageFor(model => model.AddressLine2)
			  </div>
			</div>
			<div class="field">
			  <div class="label">
				@Html.Label(Resources.AddressResources.City)
			  </div>
			  <div class="editor">
				@Html.TextBoxFor(model => model.City)
				@Html.ValidationMessageFor(model => model.City)
			  </div>
			</div>
			<div class="field">
			  <div class="label">
				@Html.Label(Resources.AddressResources.StateProvince)
			  </div>
			  <div class="editor">
				@Html.TextBoxFor(model => model.StateProvince)
				@Html.ValidationMessageFor(model => model.StateProvince)
			  </div>
			</div>
			<div class="field">
			  <div class="label">
				@Html.Label(Resources.AddressResources.PostalCode)
			  </div>
			  <div class="editor">
				@Html.TextBoxFor(model => model.PostalCode)
				@Html.ValidationMessageFor(model => model.PostalCode)
			  </div>
			</div>
			<div class="field">
			  <div class="label">
				@Html.Label(Resources.AddressResources.Country)
			  </div>
			  <div class="editor">
				@Html.TextBoxFor(model => model.Country)
				@Html.ValidationMessageFor(model => model.Country)
			  </div>
			</div>
			<div class="field">
			  <div class="label">
				@Html.Label(Resources.AddressResources.IsBilling)
			  </div>
			  <div class="editor">
				@Html.CheckBoxFor(model => model.IsBilling)
				@Html.ValidationMessageFor(model => model.IsBilling)
			  </div>
			</div>
		@if(ViewBag.MasterProperty != null && ViewBag.MasterProperty != "Customer")
		{
			<div class="field">
			  <div class="label">
			    @Html.LabelFor(model => model.CustomerId)
			  </div>
			  <div class="editor">
			    @Html.DropDownListFor(model => model.CustomerId, new SelectList(Model.CustomerList, "Id", "IdentityDescription", Model.CustomerId))           
			    @Html.ValidationMessageFor(model => model.CustomerId)
			  </div>
			</div>
		}
		else
		{
			@Html.HiddenFor(model => model.CustomerId)
		}
		</div>
      </fieldset>
    }
    </div>
	<!-- Form end -->
</div>
<script type="text/javascript">
function @(ViewBag.Name)LoadScripts(detailName)
{
DefaultAddOrDetailPopUpEventTriggers("@(ViewBag.Name)-dialog");
}
</script>
